{include file="public/toper" /}
<div class="x-nav">
    <span class="layui-breadcrumb">
        <a href="">运营中心</a>
        <a href="">优惠券推送</a>
    </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新"><i class="layui-icon" style="line-height:30px">&#xe666;</i></a>
</div>
<div class="x-body">
    <div class="layui-row">
        <div class="layui-form layui-col-md12 x-so">
            <input type="text" name="sreach" value=""  style="width:250px;" id="key"   placeholder="优惠券名称" autocomplete="off" class="layui-input">
            <input type="text" name="sreach" value=""  style="width:300px;" id="sj"   placeholder="申请时间" readonly="readonly" autocomplete="off" class="layui-input">
            <button class="layui-btn" id="search"><i class="layui-icon">&#xe615;</i></button>
        </div>
    </div>
    <xblock class="demoTable">
        <button class="layui-btn" onclick="x_admin_show('添加优惠券推送','{:url(\'Coupons/add3\')}')"><i class="layui-icon"></i>添加</button>
    </xblock>
    <table class="layui-hide" id="test" lay-filter="test"></table>
</div>
<script type="text/html" id="action">
    <button class="layui-btn layui-btn layui-btn-xs"  onclick="x_admin_show('查看优惠券推送','{:url(\'Coupons/edit3\')}?id={{d.push_id}}')">查看</button>
</script>
<script>
    layui.use(['table','laydate'], function(){
        var table = layui.table, $ = layui.jquery;
        var layer = layui.layer;
        var laydate = layui.laydate;
        var loading = layer.load(1, {shade: [0.1,'#fff'] });
        var tableIn = table.render({
            method: 'post',
            elem: '#test'
            ,url: "{:url('Coupons/index3')}"
            ,id:'test'
            ,cols: [[
                {field:'push_id', width:80, title: '序号',align: 'center',type:'numbers'}
                ,{field:'user_id',width: 150,title: '推送用户', align: 'center'}
                ,{field:'num',width: 100,title: '推送用户数', align: 'center'}
                ,{field:'coupons_id', width:350, title: '优惠券',align: 'center'}
                ,{field:'create_time', width:180, title: '推送时间',align: 'center'}
                ,{width: 150,title: '操作', align: 'center', toolbar: '#action'}
            ]]
            ,page: true
            ,limit: 30
            ,limits:[30,60,90,120,150,180,210,240,270,300]
        });
        layer.close(loading);

        laydate.render({
            elem: '#sj'
            ,type: 'datetime'
            ,range: true
        });

        $('#search').on('click', function () {
            tableIn.reload({
                where: {key: $('#key').val(),sj:$('#sj').val()}
                ,page: {curr: 1 }
            });
        });
    });
</script>
{include file="public/footer"/}